package com.wwe.kotlinstudy.dm.eight;

/**
 * @name KotlinStudy
 * @package name：com.wwe.kotlinstudy.dm.eight
 * @anthor DavidZhang
 * @time 2018/5/11 23:41
 * @class describe
 */
public class Factory {

    public Phone sendMail(){
        return new oldMachine();
    }
    public Phone sendWechat(){
        return new smartPhone();
    }

    public Phone send(String type) {
        if ("oldMachine".equals(type)) {
            return new oldMachine();
        } else if ("smartPhone".equals(type)) {
            return new smartPhone();
        }
        return null;
    }
}
